package com.happy.controller;

import com.happy.entity.QuestionEntity;
import com.happy.service.IQuestionService;
import com.happy.util.ResultBody;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: Wuzh
 * @Description:
 * @Date Created in 16:18 2021/1/23
 * @return
 */
@RestController
@RequestMapping ("/question")
@CrossOrigin (value = "*", maxAge = 3600)
public class QuestionController {

    @Resource
    private IQuestionService iQuestionService;

    @RequestMapping ("/queryList")
    public ResultBody<QuestionEntity> questionList ( QuestionEntity questionEntity ) {
        List<QuestionEntity> questionEntities = iQuestionService.queryList ( questionEntity );
        return ResultBody.success ( questionEntities, questionEntities.size () );
    }

}
